/*
* File: response-code.ts
* Author: Zhangzhijun
* Date: 2021/10/1 17:37
* License: MulanPSL2
*/

class ResponseCode {

// 成功类错误码：20000000 ~ 20099999
// 错误类错误码：40000000 ~ 40099999
// 服务器错误码：50000000 ~ 50099999
//
// 通用成功类错误码：20000000
// 登录注册类错误码：20001000
// 用户错误码：20002000
// 分类错误：20003000
// 文章错误：20004000

  SUCCESS = 20000000
  QUERY_DB_FAILED = 20000001

  REGISTER_SUCCESS = 20001000
  LOGIN_SUCCESS = 20001001
  LOGOUT_SUCCESS = 20001002

  CREATE_USER_SUCCESS = 20002000
  UPDATE_USER_SUCCESS = 20002001
  DELETE_USER_SUCCESS = 20002002
  GET_USER_SUCCESS = 20002003

  CREATE_CATEGORY_SUCCESS = 20003000
  UPDATE_CATEGORY_SUCCESS = 20003001
  DELETE_CATEGORY_SUCCESS = 20003002
  GET_CATEGORY_SUCCESS = 20003003

  CREATE_POST_SUCCESS = 20004000
  UPDATE_POST_SUCCESS = 20004001
  DELETE_POST_SUCCESS = 20004002
  GET_POST_SUCCESS = 20004003

  CREATE_PAGE_SUCCESS = 20005000
  UPDATE_PAGE_SUCCESS = 20005001
  DELETE_PAGE_SUCCESS = 20005002
  GET_PAGE_SUCCESS = 20005003

  CREATE_TAG_SUCCESS = 20006000
  UPDATE_TAG_SUCCESS = 20006001
  DELETE_TAG_SUCCESS = 20006002
  GET_TAG_SUCCESS = 20006003

  CREATE_COMMENT_SUCCESS = 20007000
  UPDATE_COMMENT_SUCCESS = 20007001
  DELETE_COMMENT_SUCCESS = 20007002
  GET_COMMENT_SUCCESS = 20007003

  CREATE_MEDIA_SUCCESS = 20008000
  UPDATE_MEDIA_SUCCESS = 20008001
  DELETE_MEDIA_SUCCESS = 20008002
  GET_MEDIA_SUCCESS = 20008003

  UPDATE_SITEINFO_SUCCESS = 20009001
  GET_SITEINFO_SUCCESS = 20009003

  BAD_REQUEST = 40000000

  USER_NOT_EXIST = 40002000
  USER_ALREADY_EXIST = 40002001

  CATEGORY_NOT_EXIST = 40003000
  CATEGORY_ALREADY_EXIST = 40003001
  CATEGORY_ASSOCIATE_WITH_POST = 40003002

  POST_NOT_EXIST = 40004000
  POST_ALREADY_EXIST = 40004001

  PAGE_NOT_EXIST = 40005000
  PAGE_ALREADY_EXIST = 40005001

  TAG_NOT_EXIST = 40006000
  TAG_ALREADY_EXIST = 40006001

  COMMENT_NOT_EXIST = 40007000
  COMMENT_ALREADY_EXIST = 40007001

  MEDIA_NOT_EXIST = 40008000
  MEDIA_ALREADY_EXIST = 40008001
}

export default ResponseCode
